//
//  NEDRequest+Config.h
//  NEDNetwork
//
//  Created by 000 on 2021/12/26.
//

#import "NEDRequest.h"

NS_ASSUME_NONNULL_BEGIN

#define NEDRequestRegister(ResponseClass) [NEDRequest<ResponseClass *> new].responseClassRegister(ResponseClass.class)
#define NEDRequestRegisterList(ResponseClass) [NEDRequest<NSArray<ResponseClass *> *> new].responseClassRegister(ResponseClass.class)

#define PostRegister(ResponseClass) NEDRequestRegister(ResponseClass).POST
#define PostRegisterList(ResponseClass) NEDRequestRegisterList(ResponseClass).POST
#define PostRequest [NEDRequest new].POST

#define GetRegister(ResponseClass) NEDRequestRegister(ResponseClass).GET
#define GetRegisterList(ResponseClass) NEDRequestRegisterList(ResponseClass).GET
#define GetRequest [NEDRequest new].GET


@interface NEDRequest<ResponseClass>  (Config)

/// 注册请求返回类的类型
/// 配合泛型使用
- (NEDRequest<ResponseClass> *(^)(Class responseClass))responseClassRegister;

/// 配置
- (NEDRequest<ResponseClass> *)configure:(void(^)(NEDRequest * request, NEDRequestConfig * config))configBlock;

- (NEDRequest<ResponseClass> *(^)(YTKRequestMethod method))method;
- (NEDRequest<ResponseClass> *)GET;
- (NEDRequest<ResponseClass> *)POST;
- (NEDRequest<ResponseClass> *)PUT;
- (NEDRequest<ResponseClass> *)DELETE;

/// 请求失败重试次数
- (NEDRequest<ResponseClass> *(^)(NSInteger retryTimes))retryTimes;
- (NEDRequest<ResponseClass> *(^)(NSInteger retryTimeInterval))retryTimeInterval;


/// 一般是域名
- (NEDRequest<ResponseClass> *(^)(NSString * baseurl))baseurl;
/// 域名后路劲信息
- (NEDRequest<ResponseClass> *(^)(NSString * pathurl))pathurl;
/// 完整地URL 重新赋值baseurl 清空pathurl
- (NEDRequest<ResponseClass> *(^)(NSString * fullurl))fullurl;

/// 参数
- (NEDRequest<ResponseClass> *(^)(id argument))argument;

/// 显示加载提示
- (NEDRequest<ResponseClass> *)HUDLoad;
/// 显示错误的message提示
- (NEDRequest<ResponseClass> *)HUDFail;
/// 显示成功的message提示
- (NEDRequest<ResponseClass> *)HUDSuccess;

/// 打印结果信息
- (NEDRequest<ResponseClass> *)log;


@end

NS_ASSUME_NONNULL_END
